﻿@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<dynamic>

@{
    Layout = "_Layout.cshtml";
}

@section breadcrumbs
{
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try { ace.settings.check('breadcrumbs', 'fixed') } catch (e) { }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i> 
                控制台
            </li>
            <li>
                <i class="icon-comments-alt"></i>
                微信基础设置
            </li>
            <li class="active"><a href="/binding">系统绑定</a></li>
        </ul>

        @Html.Partial("_Version")
    </div>
}


<div class="page-content">
    <div class="page-header">
        <h1>
            系统绑定
        </h1>
    </div>

    <div class="row">
        <div class="col-xs-12">
            
            <div class="well">
                <h4 class="green smaller lighter">请根据以下操作指导完成公众平台绑定</h4>
            </div>
            
            <blockquote>1、配置公众平台信息：</blockquote>
            <form method="POST" action="/binding" id="bindingForm">
                <input type="hidden" id="oWeixinType" value="@Model.WeixinType"/>
                <div class="row">
                    <div class="col-xs-12">
                        <div class="form-horizontal">
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">
                                    公众号类型
                                </label>
                                <div class="col-sm-9">
                                    <label>
                                        <input name="WeixinType" type="radio" class="ace" value="1" />
                                        <span class="lbl"> 订阅号</span>
                                    </label>

                                    <label>
                                        <input name="WeixinType" type="radio" class="ace" value="2"  />
                                        <span class="lbl"> 认证订阅号</span>
                                    </label>

                                    <label>
                                        <input name="WeixinType" type="radio" class="ace" value="3"  />
                                        <span class="lbl"> 服务号</span>
                                    </label>

                                    <label>
                                        <input name="WeixinType" type="radio" class="ace" value="4"  />
                                        <span class="lbl"> 认证服务号</span>
                                    </label>

                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">
                                    Token
                                </label>
                                <div class="col-sm-9">
                                    <input class="col-xs-10 col-sm-5" name="WeixinToken" id="WeixinToken" placeholder="微信公众平台Token" type="text" value="@Model.WeixinToken"/>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">
                                    EncodingAESKey
                                </label>
                                <div class="col-sm-9">
                                    <input class="col-xs-10 col-sm-5" name="WeixinEncodingAesKey" id="WeixinEncodingAesKey" placeholder="请填写微信公众平台消息加解密密钥" type="text" value="@Model.WeixinEncodingAesKey" />
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">
                                    AppId
                                </label>
                                <div class="col-sm-9">
                                    <input class="col-xs-10 col-sm-5" name="WeixinAppId" id="WeixinAppId" placeholder="请填写微信公众平台AppId" type="text" value="@Model.WeixinAppId" />
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label no-padding-right">
                                    AppSecret
                                </label>
                                <div class="col-sm-9">
                                    <input class="col-xs-10 col-sm-5" name="WeixinAppSecret" id="WeixinAppSecret" placeholder="请填写微信公众平台AppSecret" type="text" value="@Model.WeixinAppSecret" />
                                </div>
                            </div>
                            <div class="space-4"></div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="clearfix form-actions">
                        <div class="col-md-offset-3 col-md-9">
                            <button class="btn btn-info" type="submit">
                                <i class="icon-ok bigger-110"></i>
                                确定保存
                            </button>
                            <button class="btn" type="reset">
                                <i class="icon-refresh bigger-110"></i>
                                重置
                            </button>
                        </div>
                    </div>
                </div>
            </form>
            
            <blockquote>
                2、您的系统接口地址为：<strong class="text-danger">@ViewBag.SysUrl/api/weixin</strong>
                @if (ViewBag.SysPort != 80)
                {
                    <strong class="text-info">(注意：您的系统地址采用的端口不是80端口，无法作为公众平台接口地址。)</strong>
                }
                
            </blockquote>
            <p>请在微信公众平台填写以上接口地址。<strong class="text-warning">请注意微信公众平台接口地址只支持80端口，并且必须是域名，不能用IP地址。</strong></p>
            
            <blockquote>3、测试接口</blockquote>
            <p>向公众平台发送关键词【为爱升级】，如收到文本信息：“博龍微信管理系统强力驱动”则表示对接成功。</p>
            <p><img src="~/Content/assets/images/binding_2.png" width="300"/></p>

        </div>
    </div>
</div>

@section PageScript
{
    <script src="~/Content/assets/page/binding.js" type="text/javascript"></script>
}